package org.csu.lestore.api.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.csu.lestore.api.common.CommonResponse;
import org.csu.lestore.api.entity.*;
import org.csu.lestore.api.vo.CategoryVO;
import org.csu.lestore.api.vo.ItemVO;
import org.csu.lestore.api.vo.ProductVO;

public interface CatalogService {
    CommonResponse<IPage<CategoryVO>> getCategoryListInPage(int curPage, int size);
    CommonResponse<CategoryVO> getCategoryById(int categoryId);
    CommonResponse<IPage<ProductVO>> getProductListInPage(int curPage, int size);
    CommonResponse<IPage<ProductVO>> getProductListInPageByCategoryId(int curPage, int size,int categoryId);
    CommonResponse<ProductVO> getProductById(int productId);
    CommonResponse<IPage<ProductVO>> getProductByName(int curPage, int size,String name);
    CommonResponse<IPage<ItemVO>> getItemsInPageByProductId(int curPage, int size,int productId);
    CommonResponse<ItemVO> getItemByItemId(int itemId);
    CommonResponse<ItemVO> getItemByAttr(int productId,String attr1,String attr2,String attr3);
    CommonResponse<CategoryVO> insertCategory(CategoryVO categoryVO);
    CommonResponse<Category> updateCategory(Category category);
    CommonResponse<Category> deleteCategory(int categoryId);
    CommonResponse<Product> insertProduct(Product product);
    CommonResponse<Product> updateProduct(Product product);
    CommonResponse<Product> deleteProduct(int productId);
    CommonResponse<ItemVO> insertItem(ItemVO itemVO);
    CommonResponse<Item> updateItem(Item item);
    CommonResponse<Item> deleteItem(int itemId);
    CommonResponse<Img> setProductImg(Img img);
    CommonResponse<CategoryVO> setCategoryImg(int categoryId, String imgSrc);
    CommonResponse<ItemVO> setItemImg(int itemId, String imgSrc);

    CommonResponse<Fav> setFavProduct(Fav fav);
    CommonResponse<Fav> deleteFavProduct(Fav fav);
    CommonResponse<Fav> getFavProduct(int userId,int productId);
    CommonResponse<IPage<ProductVO>> getFavProductListInPageByUserIdAndKeyword(int curPage, int size,int userId,String keyword);
    CommonResponse<IPage<ProductVO>> getFavProductListInPageByUserId(int curPage, int size,int userId);
    CommonResponse<Browse> insertBrowseRecord(int userId,int productId);
    CommonResponse<Browse> deleteBrowseRecord(int userId,int productId);
    CommonResponse<Browse> deleteAllBrowseRecordsByUserId(int userId);
    CommonResponse<IPage<ProductVO>> getAllBrowseRecordsByUserId(int curPage, int size,int userId);

}
